﻿Imports Tohto.Base.DBUtility
Imports Tohto.Base.Entity
Imports Oracle.DataAccess.Client
Imports System.Text

Public Class RP0040B01

    Public Function Fecth_List(ByVal strI_VC_LOGINID As String, _
                              ByVal strI_VC_KOJI_NO As String, _
                              ByVal strI_VC_MITUMORI_NO As String, _
                              ByVal strI_VC_KOJI_KB As String, _
                              ByVal strI_VC_SEIKYUSAKI_SHUBETU As String, _
                              ByVal strI_VC_REPORT_KB As String, _
                              ByRef errInfo As PLSQLErrorInfo) As DataSet
        errInfo.Clear()

        Dim strCmdText As String
        strCmdText = "PG_RP0040.FETCH_LIST"

        Dim parameters(8) As OracleParameter

        'ログインID
        Dim I_VC_LOGIN_ID As New OracleParameter("I_VC_LOGINID", OracleDbType.Varchar2, ParameterDirection.Input)
        I_VC_LOGIN_ID.Value = strI_VC_LOGINID

        Dim I_VC_KOJI_NO As New OracleParameter("I_VC_KOJI_NO", OracleDbType.Varchar2, ParameterDirection.Input)
        I_VC_KOJI_NO.Value = strI_VC_KOJI_NO

        Dim I_VC_MITUMORI_NO As New OracleParameter("I_VC_MITUMORI_NO", OracleDbType.Varchar2, ParameterDirection.Input)
        I_VC_MITUMORI_NO.Value = strI_VC_MITUMORI_NO

        Dim I_VC_KOJI_KB As New OracleParameter("I_VC_KOJI_KB", OracleDbType.Varchar2, ParameterDirection.Input)
        I_VC_KOJI_KB.Value = strI_VC_KOJI_KB

        Dim I_VC_SEIKYUSAKI_SHUBETU As New OracleParameter("I_VC_SEIKYUSAKI_SHUBETU", OracleDbType.Varchar2, ParameterDirection.Input)
        I_VC_SEIKYUSAKI_SHUBETU.Value = strI_VC_SEIKYUSAKI_SHUBETU

        Dim I_VC_REPORT_KB As New OracleParameter("I_VC_REPORT_KB", OracleDbType.Varchar2, ParameterDirection.Input)
        I_VC_REPORT_KB.Value = strI_VC_REPORT_KB

        Dim O_CU_MITUMORI_HOKOKU As New OracleParameter("O_CU_MITUMORI_HOKOKU", OracleDbType.RefCursor, ParameterDirection.Output)
        Dim O_CU_ERR As New OracleParameter("O_CU_ERR", OracleDbType.RefCursor, ParameterDirection.Output)
        Dim O_STATS As New OracleParameter("O_STATS", OracleDbType.Int32, ParameterDirection.ReturnValue)

        parameters(0) = I_VC_LOGIN_ID
        parameters(1) = I_VC_KOJI_NO
        parameters(2) = I_VC_MITUMORI_NO
        parameters(3) = I_VC_KOJI_KB
        parameters(4) = I_VC_SEIKYUSAKI_SHUBETU
        parameters(5) = I_VC_REPORT_KB
        parameters(6) = O_CU_MITUMORI_HOKOKU
        parameters(7) = O_CU_ERR
        parameters(8) = O_STATS

        Dim ds As DataSet = Nothing
        Dim tableNames(0) As String
        tableNames(0) = "O_CU_MITUMORI_HOKOKU"

        ds = OracleHelp.FillTable(OracleHelp.ConnectionStringLocalTransaction,
                                           CommandType.StoredProcedure,
                                           strCmdText,
                                           errInfo,
                                           parameters,
                                           tableNames)

        Return ds

    End Function
End Class
